package cate.game.activity.merge.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBMergeAct;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "合服活动-基础 领取一次性奖励 请求")
public class MergeActGetOnceRewardReq implements MsgInput {
    @Override
    public MsgConfig conf() {
        return MsgIdBMergeAct.MERGE_ACT_GET_ONCE_REWARD_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getActivity().mergeActOverall.onGetMergeReward();
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        } else {
            cc.getRole().getActivity().mergeActOverall.noticeUpdate();
        }
    }
}
